package hu.dobrosi.util.log;

import java.io.OutputStream;

import javax.microedition.lcdui.TextField;

public class TextFieldLogger implements Logger {
	private TextField logTextField;

	public TextFieldLogger(TextField logTextField) {
		this.logTextField = logTextField;
	}

	public void clear() {
		logTextField.setString("");
	}

	public void print(String str) {
		logTextField.setString(logTextField.getString() + str);
	}

	public void println(String str) {
		print(str + "\r\n");
	}
	
	public void print(Exception e) {
		logTextField.setString(logTextField.getString() + e);
	}

	public void clear(int i) {
		if(logTextField.getString().length() >= i) {
			clear();
		}
	}

	public OutputStream getOutputStream() {
		return null;
	}
}
